export enum QUERTY_CONJUNCTION {
  AND = "and",
  OR = "or",
}

export enum QUERTY_OPERATOR {
  IS = "is", //等于
  IS_NOT = "isNot", //不等于（不支持日期字段）
  CONTAINS = "contains", //包含（不支持日期字段）
  DOES_NOT_CONTAIN = "doesNotContain", //不包含（不支持日期字段）
  IS_EMPTY = "isEmpty", //为空
  IS_NOT_EMPTY = "isNotEmpty", //不为空
  IS_GREATER = "isGreater", //大于
  IS_GREATER_EQUAL = "isGreaterEqual", //大于等于（不支持日期字段）
  IS_LESS = "isLess", //小于
  IS_LESS_EQUAL = "isLessEqual", //小于等于（不支持日期字段）
  LIKE = "like", //LIKE 运算符。暂未支持
  IN = "in", //IN 运算符。暂未支持
}

export interface Condition {
  field_name: string;
  operator: QUERTY_OPERATOR;
  value: string[];
}

export interface Filter {
  conjunction: QUERTY_CONJUNCTION;
  conditions: Condition[];
}

export interface Sort {
  field_name: string;
  desc: boolean;
}

export interface FSBitableQuery {
  field_names?: string[];
  filter?: Filter;
  sort?: Sort[];
}
